package http.secure.common.event;

import http.secure.common.event.entity.AuditEvent;
import org.springframework.context.ApplicationListener;

/**
 * By implementing the {@link AuditSecureListener} interface,
 * The filter logs and pushes the request originator's information when unauthorized access to the protected controller
 */
public interface AuditSecureListener extends ApplicationListener<AuditEvent> {
    default void onApplicationEvent(AuditEvent event) {
        onInterceptEvent(event);
    }

    /**
     * Trigger an event when an illegal operation is blocked
     *
     * @param event {@link AuditEvent}
     */
    void onInterceptEvent(AuditEvent event);
}
